﻿using UnityEngine;
using System.Collections;

public class CameraFollow : MonoBehaviour 
{
	//this script came from a unity tutorial for camera following
	public Transform target;		//The position that the camera will follow
	private float makeSmooth = 5f;	//the spped of the follow

	Vector3 off;					//offset from the character

	void Start()
	{
		off = transform.position - target.position; 
	}

	void FixedUpdate()
	{
		Vector3 CamPos = target.position + off;

		transform.position = Vector3.Lerp (transform.position, CamPos, makeSmooth * Time.deltaTime);
	}
}
